fix(headless): Skip early load abort in headless replay simulations#2730
fix(headless): Skip early load abort in headless replay simulations#2730githubawn wants to merge 1 commit into
Conversation
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Include/Common/GameEngine.h | Removes the inline setQuitting definition so the implementation can live in the .cpp with the headless guard. |
| Generals/Code/GameEngine/Source/Common/GameEngine.cpp | Adds non-inline setQuitting that no-ops when quitting=true in headless mode; null-guards TheGlobalData correctly. |
| Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp | Early-returns from GameLogic::quit() in headless mode to prevent replay simulations from aborting prematurely. |
| GeneralsMD/Code/GameEngine/Include/Common/GameEngine.h | Mirror of the Generals header change — removes inline setQuitting. |
| GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp | Mirror of Generals GameEngine.cpp change — identical headless guard in setQuitting. |
| GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp | Mirror of Generals GameLogic.cpp change — identical early-return guard in GameLogic::quit(). |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Replay simulation ends] --> B{GameLogic::quit called}
B --> C{Headless mode?}
C -- Yes --> D[Early return — no-op]
C -- No --> E[Normal quit flow]
E --> F[setQuitting called]
F --> G{quitting=true && headless?}
G -- Yes --> H[Early return — m_quitting stays false]
G -- No --> I[m_quitting = quitting]
D --> J[Engine loop continues]
H --> J
I --> K{m_quitting true?}
K -- Yes --> L[Engine exits]
K -- No --> J
J --> M[Next replay starts]
Reviews (7): Last reviewed commit: "fix(headless): Prevent setting quit stat..." | Re-trigger Greptile
|
did some triaging and it happens much earlier than found, run 5930 instead of 7153 https://github.com/TheSuperHackers/GeneralsGameCode/actions/runs/22267506812/job/64416452283 basically either the first or second commit of the PR |
|
As long as the test passes green, it is not working correctly. |
|
Suggest to first revert #2336 entirely, observe tests (of GitHub CI), then divide and conquer |
|
Needs Rebase too |
Avoid setting the quit or quitting state in the engine or logic while running in headless mode. This ensures that OS messages (like WM_CLOSE) or game replay quit events do not stick and prematurely abort subsequent replay simulations in the process queue. Also removes the redundant load progress bypass hack in updateLoadProgress.
|
Rebased |
Fixes the CI replay checker instantly completing introduced by #2336.
Prevents transitioning the engine to a quitting state globally and ignores quit events in GameLogic when running in headless mode. This eliminates the need for bypass hacks in GameLogic::updateLoadProgress() and ensures that early initialization triggers or replay quit events do not prematurely abort consecutive replay simulations.
Claude helped. Worked locally.